import {
  FlowNodeInputTypeEnum,
  FlowNodeTemplateTypeEnum,
  FlowNodeTypeEnum,
  WorkflowIOValueTypeEnum,
} from '@/types/workflow/constant';
import { FlowNodeTemplateType } from '@/types/workflow/node';

import { getHandleConfig } from '../../utils';

export const DindTalkRobotModule: FlowNodeTemplateType = {
  id: FlowNodeTypeEnum.dingding,
  templateType: FlowNodeTemplateTypeEnum.communication,
  flowNodeType: FlowNodeTypeEnum.pluginModule,
  sourceHandle: getHandleConfig(true, true, true, true),
  targetHandle: getHandleConfig(true, true, true, true),
  avatar: 'dingding.svg',
  name: '钉钉机器人',
  intro: '向钉钉机器人发起 webhook 请求。',
  showStatus: false,
  isTool: true,
  courseUrl: '/docs/workflow/modules/ai_chat/',
  version: '481',
  isFolded: true,
  pluginId: 'community-dingding',
  inputs: [
    // Input_Template_Stream_MODE,
    {
      key: '钉钉机器人地址',
      renderTypeList: [FlowNodeInputTypeEnum.input, FlowNodeInputTypeEnum.reference],
      label: '钉钉机器人地址',
      value: '',
      valueType: WorkflowIOValueTypeEnum.string,
      selectedTypeIndex: 0,
      canEdit: false,
      required: true,
    },
    {
      key: '加签值',
      renderTypeList: [FlowNodeInputTypeEnum.input, FlowNodeInputTypeEnum.reference],
      label: '加签',
      description: '钉钉机器人安全设置中的加签秘钥',
      required: true,
      value: '',
      valueType: WorkflowIOValueTypeEnum.string,
      selectedTypeIndex: 0,
      canEdit: false,
      defaultValue: '',
    },
    {
      key: '发送的消息',
      renderTypeList: [FlowNodeInputTypeEnum.input, FlowNodeInputTypeEnum.reference],
      label: '发送的消息',
      toolDescription: '发送的消息',
      required: true,
      value: '',
      valueType: WorkflowIOValueTypeEnum.string,
      selectedTypeIndex: 0,
      canEdit: false,
      defaultValue: '',
    },
  ],
  outputs: [],
};
